import jsonp from 'common/js/jsonp'
import {
  CommendParam,
  CommendOptions
} from './config'

// 获取各种排行榜-榜单
export function getRank() {
  let url = 'https://c.y.qq.com/v8/fcg-bin/fcg_myqq_toplist.fcg'
  const data = Object.assign({}, CommendParam, {
    // 移动端
    platform: 'h5',
    needNewCode: 1
  })
  return jsonp(url, data, CommendOptions)
}
// 获取榜单歌曲
export function getRankSongList(topid) {
  let url = 'https://c.y.qq.com/v8/fcg-bin/fcg_v8_toplist_cp.fcg'
  const data = Object.assign({}, CommendParam, {
    // 移动端
    platform: 'h5',
    needNewCode: 1,
    tpl: 3,
    page: 'detail',
    type: 'top',
    topid
  })
  return jsonp(url, data, CommendOptions)
}
